﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebManager;

namespace BaoJian.WebManager.Function.ExProduct.exchange
{
    public partial class SetExchangeState : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void Save_Click(object sender, EventArgs e)
        {
            Label label = Page.Master.FindControl("lblTitle") as Label;
            if(Session["SetExchangeState"] == null)
            {
                label.Text = "操纵超时，请重新选择要改变状态的产品记录";
                return;
            }
            string[] sel = (Session["SetExchangeState"] as string).Split(',');
            LYQ.BLL.ExchangeProduct bll = new LYQ.BLL.ExchangeProduct();
            foreach (string s in sel)
            { 
                int sid = Convert.ToInt32(s);
                LYQ.Model.ExchangeProduct model = bll.GetModel(sid);
                model.Publish = Stauts.SelectedValue;
                model.FeedBack = FeedBack.Text;
                bll.Update(model);
            }

            string url = URLUtility.UrlBase + "/WebManager/Function/ExProduct/exchange/ListExchangeProducts.aspx";
            Page.Response.Redirect(url);
        }

        protected void Cancle_Click(object sender, EventArgs e)
        {
            string url = URLUtility.UrlBase + "/WebManager/Function/ExProduct/exchange/ListExchangeProducts.aspx";
            Page.Response.Redirect(url);
        }


    }
}
